home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-25 | 3.4 KB | 177 lines | [TEXT/CWIE] |
- // CAboutDialog.cp -- dialog methods
- // Created 25/6/96 07:42 by AppMaker
-
- #include "CAboutDialog.h"
-
- #include <UReanimator.h>
- #include <URegistrar.h>
- #include <LStream.h>
- #include "CListTestData.h"
- #include <LStdControl.h>
- #include <PP_Messages.h>
- #include "CmdCodes.h"
-
- #define PPob_AboutDialogID 201
- #define RidL_AboutDialogID 201
-
- Boolean CAboutDialog::sIsRegistered = false;
-
- //----------
- void
- CAboutDialog::RegisterClass ()
- {
- URegistrar::RegisterClass ('Abog', (ClassCreatorFunc)CAboutDialog::CreateAboutDialogStream);
-
- // register the pane classes we use
-
- sIsRegistered = true;
- }
-
- //----------
- CAboutDialog*
- CAboutDialog::CreateAboutDialog (LCommander *inSuperCommander)
- {
- if (!sIsRegistered) {
- RegisterClass ();
- }
- CAboutDialog * dlog;
- dlog = ((CAboutDialog *)LWindow::CreateWindow(PPob_AboutDialogID, inSuperCommander));
- return dlog;
- }
-
- //----------
- // This is the function you register with URegistrar to create a
- // CAboutDialog from a resource
- CAboutDialog*
- CAboutDialog::CreateAboutDialogStream(
- LStream *inStream)
- {
- return (new CAboutDialog(inStream));
- }
-
- //----------
- // The default constructor does nothing.
- CAboutDialog::CAboutDialog()
- {
- }
-
- //----------
- // The read-from-stream constructor just reads a dialog object.
- CAboutDialog::CAboutDialog(
- LStream *inStream)
- : LDialogBox(inStream)
- {
- }
-
- //----------
- CAboutDialog::~CAboutDialog()
- {
- }
-
- //----------
- // This member function gets called once the containment hierarchy that contains
- // this pane has been built. It gives us a chance to get data members for
- // interesting subviews, and to do other operations now that our subviews exist.
- void
- CAboutDialog::FinishCreateSelf()
- {
- LDialogBox::FinishCreateSelf();
-
- mOKButton = (LStdButton *)FindPaneByID ('OK ');
-
- UReanimator::LinkListenerToControls(this, this, RidL_AboutDialogID);
- // the purpose is to "connect" self to whatever controls
- // that we want to "listen" to
-
- // any additional initialization for your dialog:
-
- }
-
- //----------
- void
- CAboutDialog::ListenToMessage(
- MessageT inMessage,
- void *ioParam)
- {
- switch (inMessage) {
- case msg_OK:
- GetSuperCommander()->ProcessCommand(cmdOKdialog_AboutDialog, this);
- break;
-
- case msg_Cancel:
- DoClose();
- break;
-
- default:
- ; // do something
- break;
- }
- }
-
- //----------
- Boolean
- CAboutDialog::ObeyCommand(
- CommandT inCommand,
- void *ioParam)
- {
- Boolean cmdHandled = true;
-
- switch (inCommand) {
-
- // +++ Add cases here for the commands you handle
- // Remember to add same cases to FindCommandStatus below
- // to enable/disable the commands
-
-
- default:
- cmdHandled = LWindow::ObeyCommand(inCommand, ioParam);
- break;
- }
-
- return cmdHandled;
- }
-
- //----------
- void
- CAboutDialog::FindCommandStatus(
- CommandT inCommand,
- Boolean &outEnabled,
- Boolean &outUsesMark,
- Char16 &outMark,
- Str255 outName)
- {
- outUsesMark = false;
-
- switch (inCommand) {
-
- // +++ Add cases here for the commands you handle
-
-
- default:
- LDialogBox::FindCommandStatus(inCommand, outEnabled,
- outUsesMark, outMark, outName);
- break;
- }
- }
-
- //----------
- Boolean
- CAboutDialog::FocusDraw()
- {
- Boolean focused = LView::FocusDraw();
-
- if (focused) {
- AuxWinHandle awHndl;
- CTabHandle awCTable;
- ColorSpec contentSpec;
-
- GetAuxWin(GetMacPort(), &awHndl);
- awCTable = (**awHndl).awCTable;
- contentSpec = (**awCTable).ctTable [wContentColor]; // should search vs. index
- ::RGBBackColor(&contentSpec.rgb);
- }
-
- return focused;
- }
-
-